package com.mobbanana.xposedkit.common

import java.io.*
import java.nio.charset.StandardCharsets

object FileUtil {

    fun readFileAsString(filePath: String): String? {
        var text: String = ""
        val file: File = File(filePath)
        if (file.exists() && file.isFile) {
            val ipsr: InputStreamReader = InputStreamReader(FileInputStream(file), "UTF-8")
            text = ipsr.readText()
        }
        return text
    }
}